﻿package XFComponent
{
	import flash.display.Graphics;
	import flash.display.DisplayObject;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	public class XFImage extends Sprite
	{
		private var _asset : DisplayObject	=	null;

		public function XFImage() {
			// constructor code
		}
		
		[inspectable(defaultValue = null) ]
		public function set source( val : DisplayObject ) : void
		{
			if( val != null && _asset != val )
				addChild( val );
			else if( _asset != null )
				removeChild( _asset );
			
			_asset	=	val;
		}
		
		public function get source() : DisplayObject
		{
			return _asset;
		}
	}
}
